package cn.wolfcode.util;

import cn.wolfcode.exception.LogicException;
import org.springframework.util.StringUtils;

public class AssertUtil {

    public static void haslength(String value,String msg){
        if (!StringUtils.hasLength(value)){
            throw new LogicException(msg);
        }
    }

    public static void isEquals(String v1, String v2, String msg) {
        if (v1 == null || v2 == null){
            throw new LogicException("参数不能为空");
        }
        if (!v1.equals(v2)){
            throw new LogicException(msg);
        }
    }
}
